package com.smile.lyh;

import com.smile.lyh.service.OrderService;
import com.smile.lyh.service.UserInterface;
import com.smile.spring.MyApplicationContext;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2021/12/11 17:09
 */
public class Test {
    public static void main(String[] args) {
        MyApplicationContext applicationContext=new MyApplicationContext(AppConfig.class);
        UserInterface userService = (UserInterface) applicationContext.getBean("userService");
        OrderService orderService = (OrderService) applicationContext.getBean("orderService");
        userService.test();
        orderService.test();


        System.out.println("########## scoup测试");
        // UserService 设置 @Scope
        System.out.println(applicationContext.getBean("myScopeService"));
        System.out.println(applicationContext.getBean("myScopeService"));

    }
}
